home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / sndhrdw / dkong.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  2KB  |  145 lines

  1. #include "driver.h"
  2. #include "cpu/i8039/i8039.h"
  3.  
  4. static int walk = 0; /* used to determine if dkongjr is walking or climbing? */
  5.  
  6. WRITE_HANDLER( dkong_sh_w )
  7. {
  8.     if (data)
  9.         cpu_cause_interrupt(1,I8039_EXT_INT);
  10. }
  11.  
  12.  
  13. WRITE_HANDLER( dkong_sh1_w )
  14. {
  15.     static int state[8];
  16.  
  17.     if (state[offset] != data)
  18.     {
  19.         if (data)
  20.             sample_start (offset, offset, 0);
  21.  
  22.         state[offset] = data;
  23.     }
  24. }
  25.  
  26.  
  27.  
  28.  
  29. WRITE_HANDLER( dkongjr_sh_death_w )
  30. {
  31.     static int death = 0;
  32.  
  33.     if (death != data)
  34.     {
  35.         if (data)
  36.             sample_stop (7);
  37.             sample_start (6, 4, 0);
  38.  
  39.  
  40.         death = data;
  41.     }
  42. }
  43.  
  44. WRITE_HANDLER( dkongjr_sh_drop_w )
  45. {
  46.     static int drop = 0;
  47.  
  48.     if (drop != data)
  49.     {
  50.  
  51.  
  52.         if (data)
  53.             sample_start (7, 5, 0);
  54.  
  55.         drop = data;
  56.     }
  57. }
  58.  
  59. WRITE_HANDLER( dkongjr_sh_roar_w )
  60. {
  61.     static int roar = 0;
  62.     if (roar != data)
  63.     {
  64.         if (data)
  65.             sample_start (7,2,0);
  66.         roar = data;
  67.     }
  68. }
  69.  
  70. WRITE_HANDLER( dkongjr_sh_jump_w )
  71. {
  72.     static int jump = 0;
  73.  
  74.     if (jump != data)
  75.     {
  76.         if (data)
  77.             sample_start (6,0,0);
  78.  
  79.  
  80.             jump = data;
  81.     }
  82. }
  83.  
  84.  
  85.  
  86. WRITE_HANDLER( dkongjr_sh_land_w )
  87. {
  88.     static int land = 0;
  89.  
  90.     if (land != data)
  91.     {
  92.         if (data)
  93.             sample_stop (7) ;
  94.             sample_start (4,1,0);
  95.  
  96.             land = data;
  97.     }
  98. }
  99.  
  100.  
  101.  
  102. WRITE_HANDLER( dkongjr_sh_climb_w )
  103. {
  104.     static int climb = 0;
  105.  
  106.     if (climb != data)
  107.     {
  108.         if (data && walk == 0)
  109.         {
  110.             sample_start (3,3,0);
  111.         }
  112.         else if (data && walk == 1)
  113.         {
  114.             sample_start (3,6,0);
  115.         }
  116.             climb = data;
  117.     }
  118. }
  119.  
  120.  
  121. WRITE_HANDLER( dkongjr_sh_snapjaw_w )
  122. {
  123.     static int snapjaw = 0;
  124.  
  125.     if (snapjaw != data)
  126.     {
  127.         if (data)
  128.             sample_stop (7) ;
  129.             sample_start (4,7,0);
  130.  
  131.         snapjaw = data;
  132.     }
  133. }
  134.  
  135.  
  136. WRITE_HANDLER( dkongjr_sh_walk_w )
  137. {
  138.  
  139.  
  140.     if (walk != data )
  141.     {
  142.             walk = data;
  143.     }
  144. }
  145.